Infrared or radio frequency (RF) technology is commonly employed for remote control apparatus. At present, the infrared remote control apparatus has advantages of being small in size and having low power consumption and low cost and, as such, is widely used. For example, an infrared remote control apparatus is disclosed in the U.S. Pat. No. 4,426,662.
Generally speaking, an infrared remote control system has a transmitting end and a receiving end. When a command is transmitted between the two ends, coding and decoding standards are needed to effectively transmit and identify the command. For example, an infrared remote control decoding technology applied to the receiving end is disclosed in U.S. Pat. No. 4,426,662. An infrared remote control command has two main classes of coding formats—one class is the RC-5 code and the RECS 80 code widely used in the European regions, and the other class is the NEC code widely used in the Far Eastern regions.
FIG. 1 shows the conventional NEC coding format of an infrared remote control command. The NEC code applies a pulse width modulation (PWM) and comprises a header pulse, a 16-bit user code having an 8-bit user code and an 8-bit user code complement, and a 16-bit data code having an 8-bit data code and an 8-bit data code complement. FIG. 2 shows a format represented by binary bits. A duration of about 1.125 milliseconds (ms), of which the pulse width at the high level is about 0.56 ms and the pulse width at the low level is about 0.56 ms, represents a binary bit “0”. Otherwise, a duration of about 2.25 ms, of which the pulse width at the high level is about 0.56 ms and the pulse width at the low level is about 1.68 ms, represents a binary bit “1”. In addition, for the header pulse, a pulse width is about 9 ms at the high level and 4.5 ms at the low level to make up a duration of about 13.5 ms.
After the transmitting end of the infrared remote control system has transmitted a remote control command, the receiving end has to decode the 16-bit data code and the 16-bit user code of the remote control command, so as to identify the meaning represented by the command. Following description takes the foregoing NEC code as an example to describe a common decoding method. The number of clock cycles between a falling edge and an adjacent rising edge of a waveform of a certain bit of a common serial code, i.e., the number of clock cycles during a low level period, is calculated to identify a corresponding binary command. Suppose a clock cycle is 1 μs, “0” is a duration with a high level of 0.56 ms and a low level of 0.56 ms, and “1” is a duration with a high level of 0.56 ms and a low level of 1.68 ms. When the number of clock cycles between a failing edge and an adjacent rising edge of the waveform is 560 (0.56 ms/1 μs), the corresponding bit is decoded as “0”; when the number of clock cycles between a falling edge and an adjacent rising edge of the waveform is 1680 (1.68 ms/1 μs), the corresponding bit is decoded as “1”. Accordingly, the corresponding binary command is decoded by counting the number of the clock cycles.
It is to be noted that, in the foregoing decoding method, before a value of a data bit is determined, two intervals of the number of clock cycles such as the intervals from 550 to 570 and 1670 to 1690 are defined. When the number of clock cycles between the failing edge and the adjacent rising edge lies within the interval of 550 to 570, it represents the bit value of “0”. Otherwise, when the number of clock cycles between the failing edge and the adjacent rising edge lies within the interval of 1670 to 1690, it represents the bit value of “1”. However, the pulse waveform may be deformed after the infrared remote control command is transmitted. For example, the pulse width may become larger or smaller. Under such circumstances, the prior decoding method using fixed intervals of the number of clock cycles is not able to obtain a correct bit value of the command.